# To change this template, choose Tools | Templates
# and open the template in the editor.
require 'distance/distance'

class DistanceUtils
  # Data una matrice di array, restituisce una matrice di distanza
  def DistanceUtils.ddmatrix(matrix)
    ddmatrix=[]

    (0..matrix.size-1).each{|i|
      dvec=[]

      (0..matrix.size-1).each{|j|
        dvec.push(Distance.eclidean(matrix[i], matrix[j]))
      }
      ddmatrix.push(dvec)
    }

    return ddmatrix
  end
end
